package com.rzx.mybackend.controller.merchandise;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rzx.mybackend.common.PageResult;
import com.rzx.mybackend.common.Result;
import com.rzx.mybackend.dto.MerchandisePageDTO;
import com.rzx.mybackend.entity.Merchandise;
import com.rzx.mybackend.service.MerchandiseService;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * MerchandiseController
 *
 * @author renzhexian
 * @date 2025/8/13
 */
@RestController
@RequestMapping("/merchandise")
@RequiredArgsConstructor
public class MerchandiseController {

    private final MerchandiseService merchandiseService;

    @GetMapping("/page")
    public Result<PageResult> page(MerchandisePageDTO merchandisePageDTO) {

        return Result.success(merchandiseService.page(merchandisePageDTO));
    }
}
